package encapsulation;

public class One {
    public static void main(String[] args) {
        Animal ani=new Animal();
        ani.name="鳄鱼";
        ani.legs=4;
        ani.eat();
        ani.Skill("死亡翻滚");
        ani.Name(ani.name);
        ani.Legs(ani.legs);
    }
}
class Animal{
    String name;
    int legs;
    public void eat(){
        System.out.println("动物觅食");
    }
    public void Skill(String s){
        System.out.println("技能："+s);
    }
    public void Name(String n){
        System.out.println("是："+n);
    }
    public void Legs(int s){
        System.out.println("腿："+s+"条");
    }
}
